import { Module } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';
import { TypeOrmModule } from '@nestjs/typeorm';
import { ConfigModule } from '@nestjs/config';
import { QuestionModule } from './modules/question/question.module';
import { ResultModule } from './modules/result/result.module';
import { SurveyModule } from './modules/survey/survey.module';
import { UploadModule } from './modules/upload/upload.module';

@Module({
  imports: [
    ConfigModule.forRoot(),
    TypeOrmModule.forRoot({
      host: 'localhost',
      username: 'root',
      password: '123456',
      database: 'question_com',
      type: 'mysql',
      port: 3306,
      entities: [__dirname + '/./**/*.entity.{js,ts}'],
      synchronize: true,
      autoLoadEntities: true,
    }), QuestionModule, ResultModule, SurveyModule, UploadModule,],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule { }
